package eu.goldenak.ircbot.module;

import eu.goldenak.ircbot.*;
import java.util.HashMap;

/**
 * This module will be run in a separate thread, and thus will be looping by itself in the run() method. 
 * 
 * This can be used for more critical tasks, like an administratormodule, or something. 
 */
public interface BotModuleThread extends Runnable {
	/**
	 * Returns the name of the current module, which is also used for configfiles.
	 */
	public String getName();
	/**
	 * Returns the current version of this module, as an integer, so no fancy stuff here.
	 */
	public int getVersion();
	/**
	 * Returns a String array with the keys of the settings which are required in the configfile.
	 */
	public String[] getRequiredSettings();
	/**
	 * Returns a String array with the keys of the settings which are optional in the configfile.
	 * I'm not quite sure whether we need this though.
	 */
	//public String[] getOptionalSettings();
	/**
	 * Once the configfile has been parsed, it is passed to the module using this method.
	 */
	public void setConfig(HashMap<String, String> c);
	/**
	 * Called when the module is initialized.
	 */
	public void init();
	/**
	 * Gets called when a new message is received by the bot.
	 */
	public void read(IrcData data);
	/**
	 * Gets called after all modules have been processed and the
	 * returned String array of messages will be evenly distributed
	 * over the connected bots.
	 */
	public String[] getDistributeMessages();
}